class NewsListItemData {
  String id;
  String title;
  String time;
  String source;
  String content;
  String headerImagePath;

  NewsListItemData(
    this.id,
    this.title,
    this.time,
    this.source,
    this.content,
    this.headerImagePath,
  );

  static NewsListItemData fromMap(Map<String, dynamic> map) {
    return NewsListItemData(
      map['id'].toString(),
      map['title'],
      map['time'].toString().substring(0, 10),
      map['source'],
      map['content'],
      map['headerImage'],
    );
  }
}
